<aside class="use-tit event-item clearfix ">
  <h2 class="text-left col-xs-9">Học vấn </h2>
    <div class="text-right col-xs-3 col-right">
      <?php 
            echo CHtml::ajaxLink(
                      "Thêm học vấn",
                      Yii::app()->createUrl('/Users/profiles/addstudy'),
                      array( // ajaxOptions
                        'type' =>'POST',
                        'dataType' => 'json',
                        'success' => 'function(data)
                          {
                            $("#use-add-study").html(data.views);
                            $("#use-add-study").show();
                          }',
                      ),
                      array('class'=>'user-link-add', 'href' => Yii::app()->createUrl('/Users/profiles/addstudy'))
                    );
         ?>
      </div>
</aside>
<div class="use_hr_for"></div>
<div id="use-all-study">
<?php 
  foreach ($studys as $study) {
    echo $this->renderPartial('_viewonestudy',array('study'=>$study),false,true);
  }
 ?>
</div>

<div id="use-add-study" style="display:none"></div>
<div class="use_hr_for"></div>
<script type="text/javascript">
  function callLinkUpdate (id) {
    $.ajax({
                    type: "POST",
                    url: "<?php echo Yii::app()->createUrl('/Users/profiles/updatestudy');?>",
                    data: {id:id},
                    // cache: false,
                    success: function(data){
                      $("#use-add-study").html("");
                      $("#use-add-study").html(data);
                      $("#use-add-study").show();
                    },
            });
  }
  function callDeletestudy (id) {
    if (confirm("Bạn có xóa công việc này không?")) {
      $.ajax({
                    type: "POST",
                    url: "<?php echo Yii::app()->createUrl('/Users/profiles/deletestudy');?>",
                    data: {id:id},
                    // cache: false,
                    success: function(data){
                      $("#use-view-study"+id).remove();
                    },
            });
    };  
  }
</script>